package com.alone.jpa.entity;

import com.alone.jpa.entity.enhancer.*;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Alone
 */
@Configuration(proxyBeanMethods = false)
public class EntityListenerConfig {

    @Bean
    @ConditionalOnMissingBean
    public AutoFillHandler autoFillHandler(AutoFillDefaultValueProvider defaultValueProvider) {
        return new AutoFillHandler(defaultValueProvider);
    }

    @Bean
    @ConditionalOnMissingBean
    public UpdateIgnoreNullValueHandler updateIgnoreNullValueHandler() {
        return new UpdateIgnoreNullValueHandler();
    }

}
